package com.guyj.common.http;


import com.guyj.common.entity.RegisterUuid4AppBean;
import com.lzy.okhttputils.OkHttpUtils;
import com.lzy.okhttputils.cache.CacheMode;

/**
 *
 */
public class HttpUtils {

    private final static String TAG = "HttpUtils";
    private final static String MIYAO = "O]dWJ,[*g)%k\"?q~g6Co!`cQvV>>Ilvw";// 秘钥
    public final static String base_url = "http://www.onemorecloset.com:8081/omcserver1";
    private final static String registerUuid4App = "/app/base/registerUuid4App.action";//获取Token

    /**
     * 停止http调用
     */
    public static void cancelPost(){
        OkHttpUtils.getInstance().cancelTag(TAG);
    }

    /**
     * 获取Token
     * @param uuid androidID
     * @param callback
     */
    public static void registerUuid4App(String uuid, ResultCallback<RegisterUuid4AppBean> callback) {
        OkHttpUtils
                .post(base_url + registerUuid4App)
                .params("uuid", uuid)
                .tag(TAG)
                .cacheKey(base_url + registerUuid4App)
                .cacheMode(CacheMode.FIRST_CACHE_THEN_REQUEST)
                .cacheTime(100000)
                .execute(callback);
    }

}



